package com.hkg.springbootsutdying.entity;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * @ClassName : User
 * @Author : huaikaigang
 * @Date: 2020-05-12 19:51
 * @类描述:
 */
@PropertySource(value = {"classpath:application.yml"})
@Component //表示它是spring的组件
@ConfigurationProperties(prefix="person") //要使用此注解，前提本类必须是一个组件
public class Person {
    private String userName;
    private Integer age;
    private String password;

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public String toString() {
        return "Person{" +
                "userName='" + userName + '\'' +
                ", age=" + age +
                ", password='" + password + '\'' +
                '}';
    }
}
